const ruleArr = [
	{
		key: "contactRelativeCnt",
		reg: /(父|母|爸|妈|姑|舅|伯|叔|姨|姐|妹|哥|弟|妻|甥|侄|爹|娘)/
	},
	{
		key: "contactCollectionCnt",
		reg: /(欠债|珍惜信用|还钱|催收|律师函|判决书|循环利息|滞纳金|超额利息|讨债鬼|黑户|信用代洗|信用代刷|催债|讨债|追债)/
	},
	{
		key: "contactLoaninfoCnt",
		reg: /(黑户|白户|黑白户|借款|申请资料|申请表|提额|POS|代还|代办|养卡|高贷|贷款|小贷|民间借贷|抵押|套现|空放|空套|变现|套卡|无前期|放米|包下款|鲁钱|私货|私借|垫还|口子|做流水|水钱|点位|网黑)/
	},
	{
		key: "contactCounterfeitCnt",
		reg: /(代刷|PS去水印|印章|养卡|做流水|贷款技术|贷款技巧|网贷技术|网贷技巧|提额技术|提额技巧|信用卡资料|翻译征信|工资流水|电核|房产证外皮|土地使用证壳|户口本皮|PS修改|QQ加群技术|办证|超级资料|打卡工资服务|电话电核|电话转接|额度|改图|贷款攻略|卡神|刻章|抠图|流水工资|推荐码|网贷解读|我爱卡|下卡|信贷技巧|刷信用|信用满标)/
	}
];
const countObj = {
	contactRelativeCnt: 0,
	contactCollectionCnt: 0,
	contactLoaninfoCnt: 0,
	contactCounterfeitCnt: 0
};

export let hasRunLoop = false;

export const calData = arr => {
	arr.forEach(item => {
		ruleArr.forEach(rule => {
			if (rule.reg.test(item.contactName)) {
				countObj[rule.key] += 1;
			}
		});
	});
	hasRunLoop = true;
	return countObj;
};
